package mazeAssignment;

import java.util.LinkedList;
import java.util.List;

/**
 * Used in DijkstraShortestSolve and UnweightedShortestSolve.
 * @author Mark Allen Weiss
 */
class Vertex implements Comparable<Vertex>
{
    public int number;
    public List<Edge> edges;
    public Vertex prev;
    public double weight;
    
    
    /** Creates a new instance of Vertex */
    public Vertex(int number)
    {
        this.number = number;
        this.edges = new LinkedList<Edge>();
        reset();
    }
    
    public void reset()
    {
        this.prev = null;
        weight = Double.MAX_VALUE;
    }

    /**
     * Used in DijkstraShortestSolve.
     */
	@Override
	public int compareTo(Vertex otherVertex)
	{
		if(otherVertex == null)
			return Integer.MIN_VALUE;
		
		
		
		return (int)(this.weight - (otherVertex).weight);
	}
}
